package javase0823;

import javase0823.miao.Animal;
import javase0823.miao.Kitty;
import javase0823.miao.Puppy;

import java.io.IOException;

public class Demo03 {
    public static void main(String[] args) throws IOException {



        Animal k = new Kitty();
        Animal p = new Puppy();
        k.foo();
        p.foo();
        System.out.println("------------");
        /*Animal a1 = Animal.getInstance();
        Animal a2 = Animal.getInstance();
        Animal a3 = Animal.getInstance();
        Animal a4 = Animal.getInstance();
        Animal a5 = Animal.getInstance();*/

        //判断文件  操作 记录

        Animal a1 = Animal.getInstance();
        Animal a2 = Animal.getInstance();
        Animal a3 = Animal.getInstance();
        Animal a4 = Animal.getInstance();
        Animal a5 = Animal.getInstance();

        a1.foo();
        a2.foo();
        a3.foo();
        a4.foo();
        a5.foo();





    }
}
